//
//  TypeChange.swift
//  swiftStudy
//
//  Created by unisedu on 16/4/1.
//  Copyright © 2016年 CaoFei. All rights reserved.
//

import UIKit
/**
 类型转换
 */
class TypeChange: NSObject {
   
    func show(){
        let str = "Hello, playground"
        
        let intValue2:Int? = Int(str)
        
        
        let str2 = "12345"
        
        let intValue3:Int? = Int(str2)
        
        //可能返回nil 所以需要加"?"
        let str3 = "12345asdf"
        
        let intValue4:Int? = Int(str3)
        
        let strValue2:String = String(intValue3)
        
        let strValue3:String = String(true)
        
        debugPrint(str,intValue2,intValue4,strValue2,strValue3)

    }
}
